/*
 * Created by JFormDesigner on Sat Aug 16 14:13:03 CST 2025
 */

package org.xl.main.json;

import java.awt.*;
import javax.swing.*;

/**
 * @author Windows
 */
public class JsonFormatFrame extends JFrame {
    public JsonFormatFrame() {
        initComponents();
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents  @formatter:off
        label1 = new JLabel();
        label2 = new JLabel();
        textArea2 = new JTextArea();
        scrollPane1 = new JScrollPane();
        customTextArea = new CustomTextArea();

        //======== this ========
        setTitle("JSON\u683c\u5f0f\u5316");
        Container contentPane = getContentPane();
        contentPane.setLayout(null);

        //---- label1 ----
        label1.setText("\u539fJSON\u5b57\u7b26\u4e32:");
        contentPane.add(label1);
        label1.setBounds(new Rectangle(new Point(0, 50), label1.getPreferredSize()));

        //---- label2 ----
        label2.setText("\u683c\u5f0f\u5316\u540e\u7684\u5b57\u7b26\u4e32:");
        contentPane.add(label2);
        label2.setBounds(5, 200, 115, 17);
        contentPane.add(textArea2);
        textArea2.setBounds(110, 200, 1600, 800);

        //======== scrollPane1 ========
        {

            //---- customTextArea ----
            customTextArea.setJsonTextArea(textArea2);
            scrollPane1.setViewportView(customTextArea);
        }
        contentPane.add(scrollPane1);
        scrollPane1.setBounds(110, 5, 1600, 180);

        {
            // compute preferred size
            Dimension preferredSize = new Dimension();
            for(int i = 0; i < contentPane.getComponentCount(); i++) {
                Rectangle bounds = contentPane.getComponent(i).getBounds();
                preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
            }
            Insets insets = contentPane.getInsets();
            preferredSize.width += insets.right;
            preferredSize.height += insets.bottom;
            contentPane.setMinimumSize(preferredSize);
            contentPane.setPreferredSize(preferredSize);
        }
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents  @formatter:on
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off
    private JLabel label1;
    private JLabel label2;
    private JTextArea textArea2;
    private JScrollPane scrollPane1;
    private CustomTextArea customTextArea;
    // JFormDesigner - End of variables declaration  //GEN-END:variables  @formatter:on
}
